package com.mondo.financialwallet.data.net;

import com.mondo.financialwallet.presentation.utils.LocalConfigStorage;

import java.io.IOException;

import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;

public class HeaderInterceptor implements Interceptor {

    @Override
    public Response intercept(Chain chain) throws IOException {
        Request request = chain.request();
        String token = LocalConfigStorage.get().getToken();
        return chain.proceed(
                request.newBuilder().header("token", token)
                        .build()
        );
    }
}
